package com.scexample.common;

public enum PayTypeEnum {

    /**
     * 支付宝
     */
    aliPay(Byte.valueOf("1"), "支付宝"),
    /**
     * 微信
     */
    wxPay(Byte.valueOf("2"), "微信");

    private Byte code;

    private String name;

    PayTypeEnum(Byte code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getEnum(Byte code) {
        for (PayTypeEnum value : PayTypeEnum.values()) {
            if (value.code.equals(code)) {
                return value.name;
            }
        }
        return null;
    }

    public Byte getCode() {
        return code;
    }

    public void setCode(Byte code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
